package com.example.service.impl;

import com.example.pojo.Company;
import com.example.mapper.CompanyMapper;
import com.example.service.ICompanyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.vo.ResultVo;
import com.example.vo.respvo.DeptTree;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 公司表 服务实现类
 * </p>
 * @author wsl
 * @since 2022-04-12
 */
@Service
public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements ICompanyService {

    @Override
    public ResultVo getCompanyWithDeptList() {
        List<DeptTree> deptTrees = baseMapper.selectCompanyWithDeptList();
        return ResultVo.ok("请求成功!",deptTrees);
    }

    @Override
    public ResultVo getCompanyOptions() {
        List<Company> companyList = baseMapper.selectList(null);
        return ResultVo.response(companyList);
    }
}
